/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Meas.impl;

import EA_Model.IEC61970.Core.impl.EquipmentImpl;

import EA_Model.IEC61970.Meas.CurrentTransformer;
import EA_Model.IEC61970.Meas.MeasPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Current Transformer</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.CurrentTransformerImpl#getAccuracyClass <em>Accuracy Class</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.CurrentTransformerImpl#getAccuracyLimit <em>Accuracy Limit</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.CurrentTransformerImpl#getCoreCount <em>Core Count</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.CurrentTransformerImpl#getCtClass <em>Ct Class</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.CurrentTransformerImpl#getMaxRatio <em>Max Ratio</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.CurrentTransformerImpl#getUsage <em>Usage</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CurrentTransformerImpl extends EquipmentImpl implements CurrentTransformer {
	/**
	 * The cached value of the '{@link #getAccuracyClass() <em>Accuracy Class</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAccuracyClass()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String accuracyClass;

	/**
	 * The cached value of the '{@link #getAccuracyLimit() <em>Accuracy Limit</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAccuracyLimit()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String accuracyLimit;

	/**
	 * The cached value of the '{@link #getCoreCount() <em>Core Count</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCoreCount()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Integer coreCount;

	/**
	 * The cached value of the '{@link #getCtClass() <em>Ct Class</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCtClass()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String ctClass;

	/**
	 * The cached value of the '{@link #getMaxRatio() <em>Max Ratio</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaxRatio()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float maxRatio;

	/**
	 * The cached value of the '{@link #getUsage() <em>Usage</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getUsage()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String usage;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CurrentTransformerImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MeasPackage.Literals.CURRENT_TRANSFORMER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getAccuracyClass() {
		if (accuracyClass != null && accuracyClass.eIsProxy()) {
			InternalEObject oldAccuracyClass = (InternalEObject)accuracyClass;
			accuracyClass = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldAccuracyClass);
			if (accuracyClass != oldAccuracyClass) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.CURRENT_TRANSFORMER__ACCURACY_CLASS, oldAccuracyClass, accuracyClass));
			}
		}
		return accuracyClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetAccuracyClass() {
		return accuracyClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAccuracyClass(EA_Model.IEC61970.Domain.String newAccuracyClass) {
		EA_Model.IEC61970.Domain.String oldAccuracyClass = accuracyClass;
		accuracyClass = newAccuracyClass;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.CURRENT_TRANSFORMER__ACCURACY_CLASS, oldAccuracyClass, accuracyClass));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getAccuracyLimit() {
		if (accuracyLimit != null && accuracyLimit.eIsProxy()) {
			InternalEObject oldAccuracyLimit = (InternalEObject)accuracyLimit;
			accuracyLimit = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldAccuracyLimit);
			if (accuracyLimit != oldAccuracyLimit) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.CURRENT_TRANSFORMER__ACCURACY_LIMIT, oldAccuracyLimit, accuracyLimit));
			}
		}
		return accuracyLimit;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetAccuracyLimit() {
		return accuracyLimit;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAccuracyLimit(EA_Model.IEC61970.Domain.String newAccuracyLimit) {
		EA_Model.IEC61970.Domain.String oldAccuracyLimit = accuracyLimit;
		accuracyLimit = newAccuracyLimit;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.CURRENT_TRANSFORMER__ACCURACY_LIMIT, oldAccuracyLimit, accuracyLimit));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer getCoreCount() {
		if (coreCount != null && coreCount.eIsProxy()) {
			InternalEObject oldCoreCount = (InternalEObject)coreCount;
			coreCount = (EA_Model.IEC61970.Domain.Integer)eResolveProxy(oldCoreCount);
			if (coreCount != oldCoreCount) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.CURRENT_TRANSFORMER__CORE_COUNT, oldCoreCount, coreCount));
			}
		}
		return coreCount;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer basicGetCoreCount() {
		return coreCount;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCoreCount(EA_Model.IEC61970.Domain.Integer newCoreCount) {
		EA_Model.IEC61970.Domain.Integer oldCoreCount = coreCount;
		coreCount = newCoreCount;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.CURRENT_TRANSFORMER__CORE_COUNT, oldCoreCount, coreCount));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getCtClass() {
		if (ctClass != null && ctClass.eIsProxy()) {
			InternalEObject oldCtClass = (InternalEObject)ctClass;
			ctClass = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldCtClass);
			if (ctClass != oldCtClass) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.CURRENT_TRANSFORMER__CT_CLASS, oldCtClass, ctClass));
			}
		}
		return ctClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetCtClass() {
		return ctClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCtClass(EA_Model.IEC61970.Domain.String newCtClass) {
		EA_Model.IEC61970.Domain.String oldCtClass = ctClass;
		ctClass = newCtClass;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.CURRENT_TRANSFORMER__CT_CLASS, oldCtClass, ctClass));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getMaxRatio() {
		if (maxRatio != null && maxRatio.eIsProxy()) {
			InternalEObject oldMaxRatio = (InternalEObject)maxRatio;
			maxRatio = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldMaxRatio);
			if (maxRatio != oldMaxRatio) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.CURRENT_TRANSFORMER__MAX_RATIO, oldMaxRatio, maxRatio));
			}
		}
		return maxRatio;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetMaxRatio() {
		return maxRatio;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMaxRatio(EA_Model.IEC61970.Domain.Float newMaxRatio) {
		EA_Model.IEC61970.Domain.Float oldMaxRatio = maxRatio;
		maxRatio = newMaxRatio;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.CURRENT_TRANSFORMER__MAX_RATIO, oldMaxRatio, maxRatio));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getUsage() {
		if (usage != null && usage.eIsProxy()) {
			InternalEObject oldUsage = (InternalEObject)usage;
			usage = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldUsage);
			if (usage != oldUsage) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.CURRENT_TRANSFORMER__USAGE, oldUsage, usage));
			}
		}
		return usage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetUsage() {
		return usage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setUsage(EA_Model.IEC61970.Domain.String newUsage) {
		EA_Model.IEC61970.Domain.String oldUsage = usage;
		usage = newUsage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.CURRENT_TRANSFORMER__USAGE, oldUsage, usage));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_CLASS:
				if (resolve) return getAccuracyClass();
				return basicGetAccuracyClass();
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_LIMIT:
				if (resolve) return getAccuracyLimit();
				return basicGetAccuracyLimit();
			case MeasPackage.CURRENT_TRANSFORMER__CORE_COUNT:
				if (resolve) return getCoreCount();
				return basicGetCoreCount();
			case MeasPackage.CURRENT_TRANSFORMER__CT_CLASS:
				if (resolve) return getCtClass();
				return basicGetCtClass();
			case MeasPackage.CURRENT_TRANSFORMER__MAX_RATIO:
				if (resolve) return getMaxRatio();
				return basicGetMaxRatio();
			case MeasPackage.CURRENT_TRANSFORMER__USAGE:
				if (resolve) return getUsage();
				return basicGetUsage();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_CLASS:
				setAccuracyClass((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_LIMIT:
				setAccuracyLimit((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__CORE_COUNT:
				setCoreCount((EA_Model.IEC61970.Domain.Integer)newValue);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__CT_CLASS:
				setCtClass((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__MAX_RATIO:
				setMaxRatio((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__USAGE:
				setUsage((EA_Model.IEC61970.Domain.String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_CLASS:
				setAccuracyClass((EA_Model.IEC61970.Domain.String)null);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_LIMIT:
				setAccuracyLimit((EA_Model.IEC61970.Domain.String)null);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__CORE_COUNT:
				setCoreCount((EA_Model.IEC61970.Domain.Integer)null);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__CT_CLASS:
				setCtClass((EA_Model.IEC61970.Domain.String)null);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__MAX_RATIO:
				setMaxRatio((EA_Model.IEC61970.Domain.Float)null);
				return;
			case MeasPackage.CURRENT_TRANSFORMER__USAGE:
				setUsage((EA_Model.IEC61970.Domain.String)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_CLASS:
				return accuracyClass != null;
			case MeasPackage.CURRENT_TRANSFORMER__ACCURACY_LIMIT:
				return accuracyLimit != null;
			case MeasPackage.CURRENT_TRANSFORMER__CORE_COUNT:
				return coreCount != null;
			case MeasPackage.CURRENT_TRANSFORMER__CT_CLASS:
				return ctClass != null;
			case MeasPackage.CURRENT_TRANSFORMER__MAX_RATIO:
				return maxRatio != null;
			case MeasPackage.CURRENT_TRANSFORMER__USAGE:
				return usage != null;
		}
		return super.eIsSet(featureID);
	}

} //CurrentTransformerImpl
